"""bazelbuild/rules_rust - bazel_env/bzlmod example

See https://github.com/buildbuddy-io/bazel_env.bzl.
"""

module(
    name = "all_crate_deps_bzlmod_example",
    version = "0.0.0",
)

bazel_dep(name = "platforms", version = "0.0.9")
bazel_dep(
    name = "rules_rust",
    version = "0.0.0",
)
local_path_override(
    module_name = "rules_rust",
    path = "../..",
)

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(edition = "2021")
use_repo(
    rust,
    "rust_toolchains",
)

register_toolchains("@rust_toolchains//:all")

crate = use_extension(
    "@rules_rust//crate_universe:extension.bzl",
    "crate",
)
crate.from_cargo(
    name = "crates",
    cargo_lockfile = "//:Cargo.lock",
    manifests = [
        "//:Cargo.toml",
        "//rust/hello_world:Cargo.toml",
    ],
)
use_repo(crate, "crates")

bazel_dep(name = "bazel_env.bzl", version = "0.1.1")
